<?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:65:"C:\wamp200\www\xgwnew/application/index\view\address\addqiye.html";i:1533868906;s:61:"C:\wamp200\www\xgwnew/application/index\view\public\base.html";i:1537861369;}*/ ?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<title><?php echo $title; ?></title>
<link rel="stylesheet" href="__PUBLIC__/xsd/css/mui.min.css">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/xsd/css/icons-extra.css" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/xsd/css/app.css?v1111121" />

</head>
<!--/head-->
<body>
<script src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js" charset="utf-8"></script>
    <script type="text/javascript" src="https://apis.map.qq.com/tools/geolocation/min?key=QQ6BZ-24HC6-ZAXSZ-MTZAU-5MU2J-HEFEH&referer=鲜果屋"></script>
<script>
//alert("cc");
		  var geolocation = new qq.maps.Geolocation();
     var options = {timeout: 9000};
        var positionNum = 0;
	geolocation.getLocation(showPosition, showErr, options);
	
	function showPosition(position) {
		
            positionNum ++;
            document.getElementById("demo").innerHTML += "序号：" + positionNum;
            document.getElementById("demo").appendChild(document.createElement('pre')).innerHTML = JSON.stringify(position, null, 4);
            document.getElementById("pos-area").scrollTop = document.getElementById("pos-area").scrollHeight;
        };
 
        function showErr() {
            positionNum ++;
            document.getElementById("demo").innerHTML += "序号：" + positionNum;
            document.getElementById("demo").appendChild(document.createElement('p')).innerHTML = "定位失败！";
            document.getElementById("pos-area").scrollTop = document.getElementById("pos-area").scrollHeight;
        };

	
</script>

	<!--/header-->

<link rel="stylesheet" type="text/css" href="__PUBLIC__/xsd/css/checkout.css" />
<style>
.mui-btn-block{
  padding: 5px;
  border: 1px solid #ccc !important;
  margin: 5px;
  -webkit-appearance: none;
}

.fill-section {
    padding-left: 15px;
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
}

.fill-section li {
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.fill-section li:last-child {
    border-bottom: none;
}
.fill-type {
    float: left;
    line-height: 44px;
}

.customer-section .fill-type {
    width: 50px;
}

.customer-section .fill-section-right {
    margin-left: 50px;
}

.fill-phone-right {
    position: relative;
}

.fill-input {
    width: 100%;
    height: 44px !important;
    line-height: 38px !important;
    border: 0 !important;
    font-size: 14px;
    padding: 0 !important;
}

.customer-gender {
    border-top: 1px solid #f0f0f0;
    height: 44px;
}

.customer-gender-choice {
    float: left;
    width: 50%;
    height: 44px;
    line-height: 44px;
    padding-left: 10px;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

.customer-gender-choice .i-circle {
    float: left;
    width: 16px;
    height: 16px;
    line-height: 16px;
    border: 1px solid #999;
    margin: 12px 8px 0 0;
}

.customer-gender-check .i-circle {
    width: 18px;
    height: 18px;
    line-height: 18px;
    border: 0;
    background-color: #ffd300;
    text-align: center;
    color: #6b450a;
    font-size: 14px;
    font-family: 'iconfonts';
}

.customer-gender-check .i-circle:before {
    content: '\e61a';
}

.address-section .fill-section-right {
    display: block;
    height: 44px;
    margin-left: 105px;
}

.addr-icon {
    float: left;
    margin-top: 10px;
    color: #888;
}

.addr-choose {
    display: block;
    padding: 0 !important;
    line-height: 44px !important;
    height: 44px !important;
    font-size: 13px;
    color: #333;
    border: 0 !important;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: auto !important;

}

.addr-arrow {
    float: right;
    margin: 16px 12px 0 0;
    width: 10px;
    height: 10px;
    border: 1px solid #ddd;
    border-width: 1px 1px 0 0;
    -webkit-transform: rotate(45deg);
    -moz-transform: rotate(45deg);
    transform: rotate(45deg);
}

.addr-save-btn {
    width: 93%;
    height: 44px;
    margin: 15px auto;
    background-color: #fff;
    color: #fa9700;
    font-size: 16px;
    line-height: 44px;
    text-align: center;
}

.addr-tip-list {
    position: absolute;
    left: 0;
    right: 0;
    top: 44px;
    z-index: 10;
    display: none;
    background-color: #f8f8f8;
    border: 1px solid #eaeaea;
}

.addr-tip-list li {
    height: 40px;
    padding: 3px 0 3px 3px;
    border-bottom: 1px solid #eaeaea;
}

.addr-tip-list li p {
    height: 40px;
    line-height: 40px;
    padding-left: 13px;
    color: #2f2f2f;
}

.addr-tip-list li.tip-selected p {
    height: 40px;
    background-color: #eaeaea;
}

.addr-tip-list li.tip-hide {
    display: none;
}
ul, ol {
    padding-left: 0;
    list-style-type: none;
}
</style>
<div id="content">
<header class="mui-bar mui-bar-nav" style="z-index:7">
    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
    <h1 class="mui-title">添加用户信息</h1>
</header>
<div class="mui-content ">
  <h5 style="margin:10px 5px;">联系人</h5>
  <div class="formbloack username" >
      <div class="label-wrap" >用户名</div>
      <div class="input-group-wrap" >
          <div class="input-wrap" style="    padding: .173333rem 0;"> <input type="text" style="margin-bottom: 0;    padding-left: 0;" placeholder="用户名" name="username" value="<?php echo $info['username']; ?>" > </div>
          </div>
      </div>
  </div>
  <div class="formbloack phone" >
      <div class="label-wrap" >手机</div>
      <div class="input-group-wrap rightbtn">
          <div class="input-wrap" style="    padding: .173333rem 0;"> <input placeholder="手机号" type="text" name="phone" value="<?php echo $info['phone']; ?>" style="margin-bottom: 0;    padding-left: 0;"> </div>
      </div>
  </div>
  <input type="hidden" value="<?php echo $info['id']; ?>" name="id" />
  <div class="form-button-wrap" > <button class="form-button" type="button" id="addAddress" >提 交</button> </div>

</div>
</div>




<!--/#footer-->

<script src="__PUBLIC__/js/jquery.js"></script>
<script src="__PUBLIC__/xsd/js/mui.min.js"></script>
<script src="__PUBLIC__/xsd/js/flexible.js"></script>
<script src="__PUBLIC__/xsd/js/template.js"></script>



<script type="text/javascript">


  $(function(){



    $('#addAddress').click(function(){
          var username = $.trim($('[name="username"]').val()),
              phone = $.trim($('[name="phone"]').val()),
              id =  $.trim($('[name="id"]').val());

         if (!username){
           mui.toast('请输入用户名')
           return;
         }
         if (!phone) {
            mui.toast("请输入电话号码！");
            return;
          }

         $.post("<?php echo url('index/address/addqiye', ['cid'=>$cid ]); ?>", {
           "id": id,
           "username": username,
           "phone": phone
         }, function(data) {
             if(data.code == 1){
               setTimeout(function() {
                 window.location.href="<?php echo url('index/cart/qiye', ['cid'=>$cid ]); ?>"
               }, 1000);
             }
             mui.toast(data.msg)
         }, "json");
    })

  })
</script>

<?php if(!(empty(config('shop_hours')) || (config('shop_hours') instanceof \think\Collection && config('shop_hours')->isEmpty()))): ?>
<script>
  var time_range = function (beginTime, endTime) {
    var strb = beginTime.split (":");
    if (strb.length != 2) {
      return false;
    }

    var stre = endTime.split (":");
    if (stre.length != 2) {
      return false;
    }

    var b = new Date ();
    var e = new Date ();
    var n = new Date ();

    b.setHours (strb[0]);
    b.setMinutes (strb[1]);
    e.setHours (stre[0]);
    e.setMinutes (stre[1]);

    if (n.getTime () - b.getTime () > 0 && n.getTime () - e.getTime () < 0) {
      return true;
    } else {

      mui.alert("<?php echo config('shop_hours_message'); ?>", '公告');
      $('.mui-popup-buttons').html(' ')
      $('.mui-popup-inner').css('border-radius', '13px')
      return false;
    }
  }

  var shop_hours = "<?php echo config('shop_hours'); ?>";
  var hours_arr = shop_hours.split('-');
  time_range (hours_arr[0], hours_arr[1]);

</script>
<?php endif; if(config('is_rest') == '1'): ?>
<script>
mui.alert("<?php echo config('rest_message'); ?>", '公告');
$('.mui-popup-buttons').html(' ')
$('.mui-popup-inner').css('border-radius', '13px')
</script>
<?php endif; ?>



<script>
  $(function(){
    $('.subsc').click(function(){
      // $.get("<?php echo url('index/clearusersession'); ?>", function(data){
      //   if(data.code == 1){
      //     window.location.href = "http://mp.weixin.qq.com/s/-AzpDTU7eAD24-R5QUP0wg"
      //   }
      // })
      //cookie('goodsmodel_id', $model_id);
      <?php switch(cookie('goodsmodel_id')): case "1":case "2":case "21":case "22":case "3": ?>
            mui.alert("<img src=<?php echo get_cover(config('frankserviceimg'), 'path'); ?> style='width:100%;'>", '长按扫二维码');
        <?php break; endswitch; if(!(empty($contact_qc) || ($contact_qc instanceof \think\Collection && $contact_qc->isEmpty()))): ?>
            mui.alert('<img src="<?php echo $contact_qc; ?>" style="width:100%;">', '长按扫二维码');
      <?php endif; ?>
    })


    $('.endlimit').each(function(){
      var $this = $(this);
      var stime = $this.attr('data-endtime');
      var starttime = new Date(stime.replace(/-/g,"/"))
      setInterval(function () {
        var nowtime = new Date();
        var time = starttime - nowtime;
        if(time > 0){
          var day = parseInt(time / 1000 / 60 / 60 / 24);
          var hour = parseInt(time / 1000 / 60 / 60 % 24);
          var minute = parseInt(time / 1000 / 60 % 60);
          var seconds = parseInt(time / 1000 % 60);
          $this.html("距结束还有:<span style='color:red'>"+ day + "天" + hour + "小时" + minute + "分钟" + seconds + "秒</span>");
        }

      }, 1000);
    })

    $('.hidecartbtn').each(function(){
      var id = $(this).attr('data-id')
      $('.cartbtn'+id).hide();
    })


  })
</script>

 

 <!-- <?php if(empty(\think\Cookie::get('positioninit')) || (\think\Cookie::get('positioninit') instanceof \think\Collection && \think\Cookie::get('positioninit')->isEmpty())): ?>
 <script type="text/javascript" src="https://3gimg.qq.com/lightmap/components/geolocation/geolocation.min.js"></script>
 <script>
   $(function(){
    var geolocation = new qq.maps.Geolocation("QQ6BZ-24HC6-ZAXSZ-MTZAU-5MU2J-HEFEH", "鲜果屋");
     geolocation.getIpLocation(showPosition, showErr)

   })

   function showPosition(position) {
     console.log(1111);
     $.getJSON("<?php echo url('index/cart/changecookie'); ?>", {name: 'positioninit', 'val': position.lat+','+position.lng}, function(json, textStatus) {});
  };
   function showErr() {
     console.log('定位失败');
   };
 </script>
 <?php endif; ?> -->

</body>
</html>
